package cn.dqy.gotanserver.support.context;

import cn.dqy.gotanserver.support.msghandle.impl.SimpleMsgProcess;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order(1)
@Component
public class SpringContextSupport implements ApplicationContextAware {
    static Logger logger = LoggerFactory.getLogger(SimpleMsgProcess.class);
    static ApplicationContext context;

    public static ApplicationContext getContext() {
        return context;
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        context=applicationContext;
        logger.info("spring容器工具类初始化完毕");
    }
}
